[slug].vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <script lang='ts' setup>
  2. import { getBlogsDetailApi, getReleaseBlogApi } from '~/api/model/blogs'
  3. import { ConstKeys } from '~/enums/const-enums'
  4. const route = useRoute()
  5. const detail = ref<any>({})
  6. const tabValue = ref('blog')
  7. const options = ref([
  8. {
  9. label: 'Read Blog',
  10. value: 'blog',
  11. },
  12. {
  13. label: 'Preview Catalog',
  14. value: 'catalog',
  15. },
  16. ])
  17. const relatedCatalog = ref<any>({
  18. thumbnailUrl: 'https://picsum.photos/300/200',
  19. contentTitle: 'EJET Spark Catalog Title',
  20. contentSubhead: 'EJET Spark catalog description, spark the trend, ignate sales.',
  21. })
  22. const slug = route.params.slug
  23. // const { data, pending, error, refresh } = await useAsyncData(
  24. // 'blog-detail',
  25. // () =>
  26. // $fetch(`${ConstKeys.DOMAINPRO}/client/content/detail`, { params: { slug } }),
  27. // )
  28. // const seoData = data.value?.result
  29. // detail.value = seoData
  30. async function getVideoOrBlogsDetail() {
  31. const res = await getBlogsDetailApi({
  32. slug,
  33. })
  34. detail.value = res
  35. }
  36. getVideoOrBlogsDetail()
  37. </script>
  38. <template>
  39. <div class="blog-detail">
  40. <div class="bg-#F3F4FB ">
  41. <div class="pt-175px pb-110px w-1200-auto flex px-60px">
  42. <img :src="detail.thumbnailUrl" alt="" srcset="" class="w-410px h-256px b-rd-10px object-cover mr-40px">
  43. <div class="flex-1 text-left">
  44. <div class="b-rd-400px left-10px text-center w-138px h-32px lh-32px bg-#f9fafd text-#9B6CFF text-14px mb-20px">
  45. {{ detail.category_dictText }}
  46. </div>
  47. <h1
  48. class="!mb-20px fw-800 text-40px ls-2 text-#333 line-clamp-2 lh-50px custom-title-font"
  49. >
  50. <!-- {{ detail.contentTitle }} -->
  51. EJET Spark Blog Title Trend Report about Catalog
  52. </h1>
  53. <div class="text-16px text-#999 lh-24px">
  54. <!-- {{ detail.contentSubhead }} -->
  55. EJET Spark description, spark the trend, ignate sales. EJET Spark catalog description, spark the trend, ignate sales. EJET Spark description, spark the trend, ignate sales. EJET Spark catalog description, spark the trend, ignate sales.
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="w-1200-auto flex pt-30px">
  61. <div class="w-840px mr-60px">
  62. <el-segmented v-model="tabValue" :options="options">
  63. <template #default="scope">
  64. <div>
  65. <div>{{ scope.item.label }}</div>
  66. </div>
  67. </template>
  68. </el-segmented>
  69. <div v-show="tabValue === 'blog'" class="mt-30px content-detail custom-html" v-html="detail.content" />
  70. <div v-show="tabValue === 'catalog'" class="mt-30px">
  71. <iframe
  72. src="http://47.99.151.233:9006/js/baozhen.pdf#view=FitH&toolbar=0&scrollbar=0&navpanes=0"
  73. allowfullscreen
  74. width="100%"
  75. height="1000px"
  76. style="border: none"
  77. >
  78. 您的浏览器不支持iframe,请使用现代浏览器查看PDF。
  79. </iframe>
  80. </div>
  81. </div>
  82. <div class="flex-1">
  83. <div class="pos-relative mb-40px">
  84. <img :src="relatedCatalog.thumbnailUrl" alt="" srcset="" class="w-375px h-240px b-rd-10px object-cover">
  85. <h4
  86. class="!mb-15px !mt-30px fw-800 text-24px text-#333 line-clamp-2"
  87. >
  88. {{ relatedCatalog.contentTitle }}
  89. </h4>
  90. <div class="text-14px text-#999 lh-22px line-clamp-2 mb-20px">
  91. {{ relatedCatalog.contentSubhead }}
  92. </div>
  93. <el-button class="!bg-#9B6CFF !text-#fff !b-#9B6CFF !b-rd-380px text-14px fw-bold !h-32px px-20px">
  94. Download Catalog
  95. </el-button>
  96. </div>
  97. <div class="px-40px pt-34px bg-#E7EAFF b-rd-10px text-center custom-main">
  98. <div class="text-#333 fw-500">
  99. Contact Us to Get
  100. </div>
  101. <div class="text-#333 fw-500 my-6px">
  102. Exclusive Trending Products
  103. </div>
  104. <div class="text-#333 fw-500">
  105. Solutions
  106. </div>
  107. <el-button class="mt-20px !bg-#fff !text-#9B6CFF !w-160px !h-40px !b-0px !b-rd-200px" round>
  108. <nuxt-link :to="{ name: 'contact' }">
  109. Contact Us
  110. </nuxt-link>
  111. </el-button>
  112. </div>
  113. </div>
  114. </div>
  115. <common-block-blog class="!pb-0" />
  116. <AppFooter />
  117. </div>
  118. </template>
  119. <style lang='less' scoped>
  120. .el-segmented {
  121. --el-segmented-item-selected-color: #fff;
  122. --el-segmented-item-selected-bg-color: #9B6CFF;
  123. --el-border-radius-base: 16px;
  124. --el-segmented-bg-color: #F9FAFB;
  125. --el-segmented-color: #333;
  126. width: 100%;
  127. height: 68px;
  128. line-height: 68px;
  129. border-radius: 300px!important;
  130. overflow: hidden;
  131. padding: 0;
  132. ::v-deep .el-segmented__group {
  133. .el-segmented__item-selected,.el-segmented__item{
  134. border-radius: 300px!important;
  135. overflow: hidden;
  136. .el-segmented__item-label{
  137. font-size: 18px;
  138. }
  139. }
  140. }
  141. }
  142. .blog-detail {
  143. ::v-deep(.content-detail) {
  144. font-family: sans-serif;
  145. h2 {
  146. font-size: 1.5em;
  147. font-family: "CustomTitleFont";
  148. margin-top: 1em !important;
  149. margin-bottom: 1em !important;
  150. font-weight: bold;
  151. }
  152. h3 {
  153. display: block;
  154. font-size: 1.17em;
  155. margin-block-start: 1em;
  156. margin-block-end: 1em;
  157. margin-inline-start: 0px;
  158. margin-inline-end: 0px;
  159. margin-bottom: 1em !important;
  160. font-weight: bold;
  161. unicode-bidi: isolate;
  162. font-family: "CustomTitleFont";
  163. }
  164. p {
  165. display: block;
  166. margin-block-start: 1em;
  167. margin-block-end: 1em;
  168. margin-inline-start: 0px;
  169. margin-inline-end: 0px;
  170. unicode-bidi: isolate;
  171. }
  172. ul {
  173. display: block;
  174. list-style-type: disc;
  175. margin-block-start: 1em;
  176. margin-block-end: 1em;
  177. margin-inline-start: 0px;
  178. margin-inline-end: 0px;
  179. padding-inline-start: 40px;
  180. unicode-bidi: isolate;
  181. li {
  182. display: list-item;
  183. text-align: -webkit-match-parent;
  184. unicode-bidi: isolate;
  185. }
  186. }
  187. ol {
  188. list-style-type: decimal;
  189. display: block;
  190. list-style-type: decimal;
  191. margin-block-start: 1em;
  192. margin-block-end: 1em;
  193. margin-inline-start: 0px;
  194. margin-inline-end: 0px;
  195. padding-inline-start: 40px;
  196. unicode-bidi: isolate;
  197. }
  198. }
  199. }
  200. .custom-main{
  201. background: url('~/assets/images/swiper_bg.png') no-repeat center center;
  202. background-size: cover;
  203. width: 300px;
  204. height: 190px;
  205. }
  206. </style>